import CallLogic from "../logic/CallLogic";
import HeroData from "../data/HeroData";

export default class CallModel {
    constructor()
    {

    }
    private static _instance:CallModel;
    /**
     * name
     */
    
    public static get instance() : CallModel {
        if (!this._instance)
        {
            this._instance = new CallModel()
        }
        return this._instance
    }
    private _callHeroData:HeroData
    
    public get callHeroObj() : HeroData {
        return this._callHeroData
    }
    /**
     * actionEnterCallResult
     */
    public actionEnterCallResult(type:number,listener?:Function) {
        let callHeroObj:object = CallLogic.instance.callHero(type)
        this._callHeroData = new HeroData(callHeroObj)
        if (listener)
        {
            listener()
        }
    }
}
